package com.start.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.start.admin.entity.StartSysRoleDataRule;
import com.start.common.details.BaseUserDetails;
import com.start.common.vo.SysMenuDataRulesVo;

import java.util.List;

public interface StartSysRoleDataRuleService extends IService<StartSysRoleDataRule> {
    List<SysMenuDataRulesVo> listByUserId(String userId);


    void saveDataRules(String roleId, String menuId, List<String> dataRuleIds);

    List<StartSysRoleDataRule> getListByRoleIdAndMenuId(String roleId, String menuId);

    /**
     * 根据用户以及组件查询数据规则
     *
     * @param userDetails
     * @param component
     * @return
     */
    List<SysMenuDataRulesVo> listByUserIdAndComponent(BaseUserDetails userDetails, String component);

    /**
     * 根据用户以及表单id查询数据规则
     *
     * @param userDetails
     * @param dynamicFormId
     * @return
     */
    List<SysMenuDataRulesVo> listByUserIdAndDynamicFormId(BaseUserDetails userDetails, String dynamicFormId);
}
